package com.zhangxu.microservice.system.biz.convert;

import com.zhangxu.microservice.system.biz.dto.CreateApplicationDTO;
import com.zhangxu.microservice.system.biz.dto.ApplicationDTO;
import com.zhangxu.microservice.system.biz.dto.UpdateApplicationDTO;
import com.zhangxu.microservice.system.dao.entity.ApplicationDO;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * 系统对象转换接口
 */
@Mapper(componentModel = "spring")
public interface ApplicationConverter {

    /**
     * applicationDO 转 applicationDTO
     *
     * @param applicationDO 系统DO
     * @return 系统DTO
     */
    ApplicationDTO toApplicationDTO(ApplicationDO applicationDO);

    /**
     * createApplicationDTO 转 SystemDO
     *
     * @param createApplicationDTO 创建系统DTO
     * @return 系统DO
     */
    ApplicationDO toApplicationDO(CreateApplicationDTO createApplicationDTO);

    /**
     * updateApplicationDTO 转 ApplicationDO
     *
     * @param updateApplicationDTO 更新系统DTO
     * @return 系统DO
     */
    ApplicationDO toApplicationDO(UpdateApplicationDTO updateApplicationDTO);


    /**
     * applicationDO 转 applicationDTO
     *
     * @param applicationDOs 系统DO
     * @return 系统DTO
     */
    List<ApplicationDTO> toApplicationDTOs(List<ApplicationDO> applicationDOs);
}